<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=9">
        <link rel="stylesheet" href="<%=basePath %>new/css/cssreset.css">
        <link rel="stylesheet" href="<%=basePath %>new/css/style.css">
        
        <link rel="stylesheet" href="<%=basePath %>new/css/style2.css">

        <script src="<%=basePath %>new/js/jquery-1.11.1.min.js"></script>
        
        <script>
        	
            $(function(){
            	 $(".write").click(function(e){
                        $('body').css("overflow","hidden")
                    e.preventDefault();
                    $("#cover4").css("display","block");
                    $("#cover4").animate({
                        width: "100%",
                        height: "1800px",
                        top: "0",
                        left: "0"
                    },10);
                    
                });
                $(".close").click(function(){
                    $('body').css("overflow","scroll")
                    $("#cover4").removeAttr("style");
                    $("#cover-content3").removeAttr("style");
                });
            	
                $('.sh1').mouseover(function(event) {
                    $('.showhide1').css('display', 'block');
                });
                $('.sh1').mouseout(function(event) {
                    $('.showhide1').css('display', 'none');
                });
                $('.sh2').mouseover(function(event) {
                    $('.showhide2').css('display', 'block');
                });
                $('.sh2').mouseout(function(event) {
                    $('.showhide2').css('display', 'none');
                });
                $('.sh3').mouseover(function(event) {
                    $('.showhide3').css('display', 'block');
                });
                $('.sh3').mouseout(function(event) {
                    $('.showhide3').css('display', 'none');
                });
                $('.sh4').mouseover(function(event) {
                    $('.showhide4').css('display', 'block');
                });
                $('.sh4').mouseout(function(event) {
                    $('.showhide4').css('display', 'none');
                });
                
            })
        </script> 
       
    </head>
    <body>
    	<div class="bigbox other">
    		<nav class="daohan">
                <ul>
                	<li class="sh1">
                        <a href="<%=basePath %>notice/findByAll.action"><p class="mline"><span class="smallicon" id="current1"></span><span class="navtxt">首页</span></p></a>  
                    </li>
                    <li>
                        <a href="<%=basePath %>client/qiangenzongcount.action?zhuizong=0"  id="sline"><p class="mline"><span class="smallicon" id="current"></span><span class="navtxt"  id="current2">用户开发</span></p></a>
                    </li>
                    <li>
                        <a href="<%=basePath %>client/selectDepOrSta.action?start=1">
                            <p class="mline">
                                <span class="smallicon" id="ziji11"></span>
                                <span class="navtxt">代理开发</span>
                            </p>
                        </a>
                    </li>
                    <li class="sh2">
                        <a href="<%=basePath %>client/selectByStaffAnd.action?start=1"><p class="mline"><span class="smallicon one1"></span><span class="navtxt">客户资料</span><span class="ripic"></span></p></a>
                       <div class="showhide2">
                            <a href="<%=basePath %>client/selectByStaffAnd.action" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji3"></span>
                                <span class="navtxt" style="font-size: 14px;color:#929da8;">用户资料</span>
                             </p>
                             </a> 

                             <a href="<%=basePath %>client/selectByStaffAnd.action?start=1" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji34"></span>
                                <span class="navtxt" id="current2" style="font-size: 14px;color:#929da8;">代理资料</span>
                             </p>
                             </a>    
                        </div>
                    </li>
                    <li>
                        <a href="<%=basePath %>approve/count.action?pageSize=0"><p class="mline"><span class="smallicon one2"></span><span class="navtxt">合同审批</span></p></a> 
                    </li>
                    <li>
                         <a href="<%=basePath %>page/pacts.jsp">
                             <p class="mline"><span class="smallicon one222"></span><span class="navtxt">开户审批表</span></p>
                         </a>
                        
                    </li>
                    <li>
                        <a href="<%=basePath %>pages/audits.jsp">
                             <p class="mline"><span class="smallicon" id="ziji4"></span><span class="navtxt">合同审核表</span></p>
                         </a>
                    </li>
                       
                    
                    <li>
                        <a href="#"><p class="mline"><span class="smallicon one3"></span><span class="navtxt">产品资源库</span></p></a>
                    </li>
                    <li>
                        <a href="#"><p class="mline"><span class="smallicon one333"></span><span class="navtxt">后台管理</span></p></a>
                    </li>
                </ul>
            </nav>
    		<div class="showbox">
                <h2 style="border-bottom:1px solid #1fd4fb;">
                	追 踪 情 况 列 表
				<span class="exit">
					<span class="ex1">姓名:${staff.staff_name}</span>
					<a href="../login/tuichustaff.action" class="ex2"><span class="exicon2"></span>切换账号</a>
					<a href="../login/tuichustaff.action" class="ex3"><span class="exicon3"></span>退出账号</a>
				</span>
                </h2>
                
	    		<div class="zhanshi">
		    		<span class="boxone">
				    		<ol class="sun">
					    		<li>
					    			<span class="sone">编号</span><br>
					    			<span class="stwo" id="newrecord_clientId">${client.client_id}</span>
					    		</li>
					    		<li>
					    			<span class="sone">客户姓名</span><br>
					    			<span class="stwo">${client.client_name}</span>
					    		</li>
					    		<li>
					    			<span class="sone">创建日期</span><br>
					    			<span class="stwo">
					    				<fmt:formatDate value="${client.client_date}" type="date"/>
					    			</span>
					    		</li>	
					    	</ol>	
		    		</span>
	    		</div>

	    		<div class="zhanshi2">
	    			<div class="boxtwo">
    	    		  	<div class="boxthree">
    	    		  		
    	    		  		<div class="formdan">
    	    		  			<form action="">

    							    <p>客户反馈</p>
    							    <textarea class="fankui" id="newrecord_text"></textarea>
    							   <p class="ee"> <a href="#" class="sm" onclick="save()">发表</a></p>
    	    		  			</form>
    	    		  			
    	    		  			<c:forEach items="${newrecords}" var="newre">
    	    		  				<p>
    	    		  					<span class="jilu">日期： <fmt:formatDate value="${newre.newrecord_date}"/></span>
    	    		  					<span class="jilu">姓名：  ${newre.newrecord_staffName}</span>
		    	    		  			<c:if test="${client.client_to == null}">
		    	    		  				<span class="ee ee2"> <span class="sm write" onclick="updatePage(${newre.newrecord_id})">编辑</span></span>
		    	    		  				<span class="ee"> <span class="sm shanchu" onclick="deletes(${newre.newrecord_id})">删除</span></span>
		    	    		  			</c:if>
		    	    		  			<br>
		    							<span class="jilu2">正文：${newre.newrecord_text}</span>
	    	    		  			</p>
    	    		  			</c:forEach>
    	    		  			
    	    		  			
    	    		  		</div>
    	    		  	</div>
	    		    </div>
	    		</div>
            </div>
            <div id="cover4">
                <div id="cover-bg4"></div>
                    <form action="javascript:update()" id="cover-content3">
                        <h4> 追 踪 情 况 修  改<span class="close"></span></h4>
                        <p class="main" style="height:100px;margin-top:35px;">
                            <span class="leftmain" style="position:absolute;">正 文</span>
                            <textarea name="" id="remarks" class="shurukuang" style="height:100px;margin-left: 31%;"></textarea>
                        </p> 
                        <p class="main" style="text-align:center;margin-top:45px;">
                            <button class="btn1 btn2" onclick="">保存</button>
                        </p>        
                    </form>
                </div>
                <div style="display: none">
                	<span class="savevalue"></span>
                </div>
    	</div>
		<script type="text/javascript">
			function save(){
				var newrecord_clientId = $("#newrecord_clientId").html();
				var newrecord_text = $("#newrecord_text").val();
				if(newrecord_text == ""){
					return;
				}
				$.ajax({
					type:"post",
					url:"<%=basePath %>/newrecord/saveNewrecord.action",
					data:"newrecord_text="+newrecord_text+"&newrecord_clientId="+newrecord_clientId,
					success:function(data){
						alert(data);
						location.href="../client/newrecord.action?id="+newrecord_clientId;
					},
					error:function(e){
					}

		   		 });
				
			}
			function updatePage(id){
				
				$.ajax({
					type:"post",
					url:"<%=basePath %>/newrecord/findById.action",
					data:"id="+id,
					success:function(data){
						var json = eval("("+data+")")
						$("#remarks").val(json[0].newrecord_text);
						$(".savevalue").html(id);
					},
					error:function(e){
					}

		   		 });
			}
			function update(){
				var id = $(".savevalue").html();
				var text = $("#remarks").val();
				var newrecord_clientId = $("#newrecord_clientId").html();
				if(text == ""){
					return;
				}
				$.ajax({
					type:"post",
					url:"<%=basePath %>/newrecord/updateNewrecord.action",
					data:"newrecord_id="+id+"&newrecord_text="+text,
					success:function(data){
						alert(data);
						location.href="../client/newrecord.action?id="+newrecord_clientId;
					},
					error:function(e){
					}

		   		 });
			}
			function deletes(id){
				var newrecord_clientId = $("#newrecord_clientId").html();
				$.ajax({
					type:"post",
					url:"<%=basePath %>/newrecord/deleteNewrecord.action",
					data:"id="+id,
					success:function(data){
						alert(data);
						location.href="../client/newrecord.action?id="+newrecord_clientId;
					},
					error:function(e){
					}

		   		 });
			}
		</script>
    </body>
</html>
